
Chapter 16.5. Augmented Reality with NyARToolkit

From:
  Killer Game Programming in Java
  Web Site: http://fivedots.coe.psu.ac.th/~ad/jg


Contact Address:
  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/jg


If you use this code, please mention my name, and include a link to the Web site.

Thanks,
  Andrew

---------------------------------
Example Files:

 * 6 Java files: 
          MultiNyAR.java, NyARMarkersBehavior.java, DetectMarkers.java,
          MarkerModel.java, PropManager.java, SmoothMatrix.java

 * a JAR file for NyARToolkit 4.1.1: NyARToolkit.jar 
      - this was generated by me and tested on Windows 7 and XP

 * 2 batch files: compile.bat, run.bat

 * Data/     // holds camera and marker information
                   -- included are PDF files for the Hiro and Kanji markers
                      which you can print out

 * models/   // holds the robot and cow 3D models

 * ncsa/     // holds a copy of the Portfolio library for loading the 3D models


 * NYAR Box/
     // this is a recoded version of the NyARToolkit example NyARJava3D.java that
        comes with the download. It has been changed to use JavaCV's FrameGrabber
        instead of JMF


---------------------------------
Installing NyARToolkit

AR applications require several libraries (aside from Java SE):

   * JavaCV   // required for capturing webcam snaps
   * OpenCV   //   :
   * Java 3D
   * NyARToolkit
   * NCSA Portfolio

  JavaCV:  http://code.google.com/p/javacv/
  I downloaded javacv-0.5-bin.zip and installed it in d:\javacv-bin

  OpenCV:  I downloaded v2.4.5 for Windows with pre-compiled binaries:
  from http://opencv.org/downloads.html and installed it in C:\opencv

  Java 3D installers for a variety of platforms can be obtained from 
  https://java3d.java.net/binary-builds.html. 
  I downloaded the 32-bit Windows installer, j3d-1_5_2-windows-i586.exe
  
  NyARToolkit: stored at http://sourceforge.jp/projects/nyartoolkit/
  Download "NyARToolkit for Java - NyARToolkit Core" v4.1.1 as a 
  zipped file called NyARToolkit-4.1.1.zip. 
  Or use the JAR version (NyARToolkit.jar) included with this code.
  
  NCSA Portfolio: can be downloaded from 
  http://fivedots.coe.psu.ac.th/~ad/jg/code/portfolio.zip
  but is also included with this code, in the ncsa/ subdirectory.

---------------------------------
Compiling and Testing NyARToolkit

Details can be found in section 1 of the chapter explaining this code,
which can be downloaded from http://fivedots.coe.psu.ac.th/~ad/jg/ch165/


---------------------------------
Compilation of the Example: 

$ compile *.java
    // you should have installed all the libraries, and check their locations
       match the paths used in compile.bat 

---------------------------------
Execution of the Example: 

$ run MultiNyAR
    // you should have installed all the libraries, and check their locations
       match the paths used in run.bat 


   // you need print outs of the Hiro and Kanji markers; 
       there are PDF files in Data\ that you can print out

---------
Last updated: 24th July 2013